package user;

import book.BookList;
import operation.*;

import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 王圆豪
 * Date: 2024-05-24
 * Time: 20:04
 */
public class Reg extends User{
    public Reg(String name) {
        super(name);
        this.iOperation = new IOperation[]{
                new Quit(),
                new FindBook(),
                new BorrowBook(),
                new ReturnBook()
        };
    }

    public int memu() {
        System.out.println("*********普通用户菜单**********");
        System.out.println("1. 查找图书");
        System.out.println("2. 借阅图书");
        System.out.println("3. 归还图书");
        System.out.println("0. 退出系统");
        System.out.println("*****************************");
        System.out.println("请选择功能：");
        Scanner sc = new Scanner(System.in);
        return sc.nextInt();
    }

    public  void doOperation(int choice, BookList bookList){
        iOperation[choice].work(bookList);
    }


}
